package messages;
import sharedspace.*;

public class MessageExecuteExamCodeCheckReply extends Message {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public enum ErrMsg{
		CODE_CORRECT,
		CODE_INCORRECT,
		CODE_CORRECT_COMP,
		CODE_CORRECT_WORD
	}

	private ErrMsg errMsg;
	private Student student;
	private ExecuteTest executeTest;
	
	public String[] ErrMsg={"Code Correct","Code Incorrect","Test is Computerized","Test is Word file"};

	public MessageExecuteExamCodeCheckReply(ErrMsg errMsg, Student student, ExecuteTest executeTest) {
		super(Message.MessageType.MESSAGE_EXECUTE_EXAM_CHECK_CODE_REPLY);
		this.errMsg = errMsg;
		this.student = student;
		this.executeTest =executeTest;
		// TODO Auto-generated constructor stub
	}
	
	public ErrMsg getError()
	{
		return this.errMsg;
	}
	
	/**
	 * 
	 * @param n index to get an Error message
	 * @return Error Message (String)
	 */
	public String GetErrorMessage(int n)
	{
		switch (errMsg){
		case CODE_CORRECT:
		{
			return ErrMsg[n];
		}	
		
		case CODE_INCORRECT:
		{
			return ErrMsg[n];
		}
		case CODE_CORRECT_COMP:
		{
			return ErrMsg[n];
		}
		case CODE_CORRECT_WORD:
		{
			return ErrMsg[n];
		}
		
		default:
			return ErrMsg[n];
		}
	}

	public ExecuteTest getExecuteTest() {
		return executeTest;
	}

	public Student getStudent(){
		return student;
	}

}

